import service from '@/utils/request'

export const useOrganizationApi = (id: number) => {
	return findById({ params: { id: id } })
}

export const findById = (params: any) => {
	return service.get('/nb/organization/findById', params)
}

export const findListAll = () => {
	return service.get('/nb/organization/list')
}

export const findChildList = (id: number) => {
	return service.get('/nb/organization/findChildList', { params: { id: id } })
}

export const useOrganizationSubmitApi = (dataForm: any) => {
	if (dataForm.id) {
		return service.post('/nb/organization/edit', dataForm)
	} else {
		return service.post('/nb/organization/add', dataForm)
	}
}
